package stdio.costa.imoca.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

@Entity
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@NamedQueries({
	@NamedQuery(name = "findReceiverByNameAndSender", query = "from Receiver r where r.name =:name and r.sender=:sender"),
	@NamedQuery(name = "findReceiverByUuidAndSender", query = "from Receiver r where r.uuid =:uuid and r.sender=:sender"),
	@NamedQuery(name = "findAllReceiversBySender", query = "from Receiver r where r.sender=:sender")})
public class Receiver extends UuidEntity implements Serializable {

	private static final long serialVersionUID = -3278002278915266897L;

	private String name;

	private String phone;

	@ManyToOne
	@XmlTransient
	private MocaUser sender;

	@Column(name = "weibo_uid")
	private String weiboUid;

	@Column(name = "qq_uid")
	private Long qqUid;

	@Column(name = "ignore_all")
	private Boolean ignoreALL;

	private String postcode;

	private String province;

	private String city;

	private String district;

	private String detail;

	public Receiver(MocaUser sender) {
		this.sender = sender;
	}

	public Receiver() {
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public MocaUser getSender() {
		return sender;
	}
	
	public String getWeiboUid() {
		return weiboUid;
	}

	public void setWeiboUid(String weiboUid) {
		this.weiboUid = weiboUid;
	}

	public Long getQqUid() {
		return qqUid;
	}

	public void setQqUid(Long qqUid) {
		this.qqUid = qqUid;
	}

	public Boolean getIgnoreALL() {
		return ignoreALL;
	}

	public void setIgnoreALL(Boolean ignoreALL) {
		this.ignoreALL = ignoreALL;
	}

	public String getPostcode() {
		return postcode;
	}

	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getDistrict() {
		return district;
	}

	public void setDistrict(String district) {
		this.district = district;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	public void setSender(MocaUser sender) {
		this.sender = sender;
	}
}
